// 创建容器
export class MicroApp extends HTMLElement {
  constructor(params) {
    super(params)
    if (!params) {
      throw Error('请使用new来创建micro-app')
    }
  }
  connectedCallback() {
    console.log('挂载');
  }
  disconnectedCallback() {
    console.log('移除');
  }
  attributeChangedCallback(name, newValue, oldValue) {
    console.log(name, newValue, oldValue);
  }
  static get observedAttributes() {
    return ['appName']
  }
}

// 注册
async function register() {
  if(!customElements.get('micro-app')){
    window.customElements.define('micro-app', MicroApp)
  }else{
    console.log('重复注册');
  }
}
